package org.programmers.anonymous.fightrobots.controller;

import java.util.List;
import java.util.Map;

import org.programmers.anonymous.fightrobots.model.ActionMessage;
import org.programmers.anonymous.fightrobots.model.ErrorMessage;
import org.programmers.anonymous.fightrobots.model.IFight;
import org.programmers.anonymous.fightrobots.model.IMessage;
import org.programmers.anonymous.fightrobots.model.IURLId;
import org.programmers.anonymous.fightrobots.model.StatusMessage;

public interface IFightController {
	
	/**
	 * Obtains the hashMap of fights
	 * @return the Map<IURLId, IFight>
	 */
	public Map<IURLId, IFight> getHashFight();

	/**
	 *  Send the action message type to the local robot and execute the apropiatted actions.
	 * @param m - message received from another robot
	 * @return a responde action message from the local robot, or null if not required.
	 */
	public IMessage receiveActionMessage(ActionMessage m);

	/**
	 * Send the status message type to the local robot and execute the apropiatted actions.
	 * @param m - message received from another robot (with status of the remote robot)
	 * @return a responde status message from the local robot, or null if not required.
	 */
	public IMessage receiveStatusMessage(StatusMessage m);
	
	/**
	 * Change the status of the robot who receives to READY
	 * @param m - message received from a BUSY robot
	 */
	public void receiveErrorMessage(ErrorMessage m);
	
	/**
	 * Send any type of message to the local robot
	 * @param m - message received from another robot
	 * @return
	 */
	public IMessage receiveMessage(IMessage m);
	
	/**
	 * Search FIGHT_ACTIVE robots, get its action and create an action message to send.
	 * @return a message to initialize a Fight
	 */
	public List<ActionMessage> getAction();
	
	/**
	 * Get the Status from the robots in fight and create a status message to send.
	 * @return a message of the status of the robot in the fight
	 */
	public List<StatusMessage> getStatus();
	

}
